#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#define MAX_LINE 1024

int main(int argc, char *argv[])
{
    FILE *fp;
    char StrLine[1024];
    int i=0,len;
    if((fp = fopen(argv[2],"r")) == NULL)
    {
        printf("error!");
        return -1;
    }
    len = atoi(argv[1]);
        while (!feof(fp))
        {
            if(i<len)
            {
                fgets(StrLine,1024,fp);
                printf("%s", StrLine);
		i++;
            }
            else break;
        }
    fclose(fp);
    return 0;
}
